-- @owner: opentestcase003
-- @date: 2022-07-13
-- @testpoint: covar_samp函数中参数为integer类型

--step1: 创建表；expect:成功
drop sequence if exists s_ustore_function_covarsamp_0001 cascade;
create sequence s_ustore_function_covarsamp_0001 increment by 1 start with 10;
drop table if exists t_ustore_function_covarsamp_0001 cascade;
create table  t_ustore_function_covarsamp_0001(col_1 integer,col_2 number(19,0), col_3 number(10,6)) with (storage_type=ustore);

begin
for i in 1..50 loop
      insert into t_ustore_function_covarsamp_0001 values(i,s_ustore_function_covarsamp_0001.nextval,i+445.255);
    end loop;
end;
/

--step2: covar_samp函数中参数为integer类型；expect:成功
select covar_samp(col_2,col_2) from t_ustore_function_covarsamp_0001 order by 1;
select covar_samp(col_3,col_3) from t_ustore_function_covarsamp_0001 order by 1;

--step3: 清理表；expect:成功
drop table t_ustore_function_covarsamp_0001;
drop sequence if exists s_ustore_function_covarsamp_0001;